<template>
  <div class="home paddingTop">
				<uc-swiper
				  :data="banner"
				  collectionName='banner'
				  :autoplay="1000"
				/>
	 <div class="home__list">
	        <hq-cell
	          v-for="(item,index) of home"
	          :key="item._id"
	          :index="index"
	          :data="item"
	          :to="`/detail/${item._id}?collectionName=home`"
	        />
	      </div>
  </div>
</template>

<script>
	
  import UcSwiper from '../components/uc-swiper/uc-swiper.vue'
  import HqCell from '../components/hq-cell/hq-cell.vue'
  
   export default {
      
      data(){
        return {
          banner:[],
          home:[]
        }
      },
      components:{
        UcSwiper,HqCell
      },
      
      mounted(){
        this.$axios({
        // axios({
          url:'/news/home',
          params:{
            _limit: 30
          },
        }).then(
		// res=>{console.log(res)}
          res=>this.home=res.data.data
        ),
        this.$axios({
        // axios({
          url:'/news/banner',
          params:{
            _limit: 5
          },
        }).then(
        res=>{
          
          res.data.data.map((item,index)=>{
            if(!item.banner.includes('http')){
              item.banner = this.$baseUrl + item.banner;
            }
            
          })
          
          this.banner=res.data.data
        }
      )
        
      }
    }
</script>

<style scoped>
  .home__list{
    padding: 0 .2rem;
  }
/*  .swiperS{
	  height: 300px;
	  background: #13CE66;
  } */
</style>
